<template>
  <div>
    <el-input placeholder="请输入内容" v-model.trim="searchInput" @keyup.enter.native="search"></el-input>
    <el-input placeholder="请输入内容2" v-model="searchInput2" @keyup.enter.native="search2($event)"
              @blur="blur"></el-input>
  </div>
</template>

<script>
export default {
  name: 'InputComponent',
  data () {
    return {
      searchInput: '',
      searchInput2: ''
    }
  },
  methods: {
    blur (e) {
      this.$set(this, 'searchInput2', e.target.value.trim())
    },
    search () {
      console.log('|' + this.searchInput + '|')
    },
    search2 (e) {
      e.target.blur()
      console.log('|' + this.searchInput2 + '|')
    }
  }
}
</script>

<style scoped>

</style>
